Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ibis duckdb no rowid #5527

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

MarcSkovMadsen
Copy link
Collaborator

@MarcSkovMadsen MarcSkovMadsen commented Nov 28, 2022

Closing #5526

Depends on #5522

Comment on lines 334 to 362
def test_datetime_xaxis(self):
"""Test to make sure a DateTimeAxis can be identified for the bokeh backend"""
plot_ibis = Curve(self.reference_table, kdims="date", vdims="actual")
# When
plot_bokeh = render(plot_ibis, "bokeh")
xaxis, yaxis = plot_bokeh.axis
# Then
assert isinstance(xaxis, bokeh_axes.DatetimeAxis)
assert isinstance(yaxis, bokeh_axes.LinearAxis)

def test_categorical_xaxis(self):
"""Test to make sure a Categorical axis can be identified for the bokeh backend"""
plot_ibis = Curve(self.reference_table, kdims="string", vdims="actual")
# When
plot_bokeh = render(plot_ibis, "bokeh")
xaxis, yaxis = plot_bokeh.axis
# Then
assert isinstance(xaxis, bokeh_axes.CategoricalAxis)
assert isinstance(yaxis, bokeh_axes.LinearAxis)

def test_numerical_xaxis(self):
"""Test to make sure a LinearAxis axis can be identified for the bokeh backend"""
plot_ibis = Curve(self.reference_table, kdims="numerical", vdims="actual")
# When
plot_bokeh = render(plot_ibis, "bokeh")
xaxis, yaxis = plot_bokeh.axis
# Then
assert isinstance(xaxis, bokeh_axes.LinearAxis)
assert isinstance(yaxis, bokeh_axes.LinearAxis)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, really appreciate your work investigating these issues. That said these tests can't live here. The plotting and data parts of HoloViews are separated for a reason and if test coverage of the data parts is sufficiently extensive then there's no reason to ever test the plotting code with different data backends.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if test coverage of the data parts is sufficiently extensive

To be clear, that is of course clearly not the case since you're discovering these issues.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the non-comprehensive test, the missing docstrings and type annotations from the base Interface also makes it harder than it has to be, to know what a method on the interface actually should do and return.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would someone be able to setup appropriate tests for a backend @philippjfr? If I look into the tests/core/data folder I see nothing that systematically tests the same things across backends?

And knowing what to test for is also quite difficult due to missing docstrings, type annotations, very complex functions and similar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are various baseclasses in tests/core/data which implement systematic tests which are then subclassed for each interface.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best thing to do is probably to continue extending tests/core/data/base HeterogeneousColumnTests with more tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically testing for datetime columns seems to be pretty lacking.

@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2022

Codecov Report

Merging #5527 (d98011b) into master (0317237) will decrease coverage by 0.50%.
The diff coverage is 11.66%.

@@            Coverage Diff             @@
##           master    #5527      +/-   ##
==========================================
- Coverage   88.07%   87.56%   -0.51%     
==========================================
  Files         302      302              
  Lines       62283    62338      +55     
==========================================
- Hits        54855    54589     -266     
- Misses       7428     7749     +321     
Impacted Files Coverage Δ
holoviews/core/util.py 85.91% <ø> (ø)
holoviews/tests/core/data/test_ibisinterface.py 4.73% <10.00%> (-75.75%) ⬇️
holoviews/core/data/ibis.py 31.14% <20.00%> (-48.32%) ⬇️
holoviews/core/data/util.py 53.57% <0.00%> (-5.36%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants